import '../model/LoginUserBean.dart';
import '../model/UserCenterBean.dart';
import 'HttpHelper.dart';

class UsermsService {
  // 用户登陆
  static const String _USER_LOGIN = "/userms/sso/loginpost";

  // 获取用户信息
  static const String _HOME_GET_USER_DETAIL = "/userms/sso/getuser";

  static Future<LoginUserBean> loginUser(params) async {
    var data = await HttpHelper.getInstance()?.postHttp<Map<String, dynamic>>(_USER_LOGIN, params);
    return LoginUserBean.fromJson(data!.data);
  }
  static Future<UserCenterBean> getUserDetail() async {
    var data = await HttpHelper.getInstance()?.postHttp<Map<String, dynamic>>(_HOME_GET_USER_DETAIL, {});
    return UserCenterBean.fromJson(data!.data);
  }
}
